package com.tuweiya.study.springmvc001.observerPattern.observer.impl;

import com.tuweiya.study.springmvc001.observerPattern.observer.IObservers;

/**
 * @Author: Mr_tu
 * @Date: Create in 13:47 2018/6/7
 * @Description: 具体观察者
 *  实现抽象观察者所要求的的更新接口，以便使本身的状态与主题状态协调
 */
public class ObserverImpl3 implements IObservers {
    // 具体观察者姓名
    private String name;

    public ObserverImpl3(String name) {
        this.name = name;
    }

    @Override
    public void updateMsg(String msg) {
        if ("我不开心".equalsIgnoreCase(msg)){
            System.out.println(name + "说：带你去跑男。");
        }
    }
}
